﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Sendz.Domain
{
    public class Attachment
    {
        // Entity
        [HiddenInput(DisplayValue = false)]
        public Guid AttachmentKey { get; set; }

        [DisplayName("File Name")]
        public string FileName { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string FilePath { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string RelPath { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string FileType { get; set; }

        [HiddenInput(DisplayValue = false)]
        public int FileSize { get; set; }

        [HiddenInput(DisplayValue = false)]
        public bool IsRemoved { get; set; }

        [HiddenInput(DisplayValue = false)]
        public DateTime? LastModified { get; set; }

        [HiddenInput(DisplayValue = false)]
        public DateTime CreatedOn { get; set; }

        // Parents
        [HiddenInput(DisplayValue = false)]
        public Guid UserKey { get; set; }
        public User User { get; set; }

        [HiddenInput(DisplayValue = false)]
        public Guid AutoResponderKey { get; set; }
        public AutoResponder AutoResponder { get; set; }

        // Constructors
        public Attachment()
        {
            this.AttachmentKey = Guid.NewGuid();
            this.CreatedOn = DateTime.Now;
        }

        public Attachment(Guid userKey, Guid autoResponderKey)
        {
            this.AttachmentKey = Guid.NewGuid();
            this.UserKey = userKey;
            this.AutoResponderKey = autoResponderKey;
            this.CreatedOn = DateTime.Now;
        }
    }
}
